package net;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class NetServer {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8888);
        System.out.println("服务器启动");
        Socket socket = serverSocket.accept();
        System.out.println("客户端连上了,Cline:"+socket);
        while (true){
            InputStream is = socket.getInputStream();
            int a;
            if ((a=is.read()) == 0){
                break;
            }
            System.out.println("接受的数据为"+ a);
        }




    }
}
